package com.cnpc.rightslogan.service.impl;

import com.cnpc.rightslogan.entity.User;
import com.cnpc.rightslogan.mapper.UserMapper;
import com.cnpc.rightslogan.service.IUserService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.List;

@Service
@Transactional
public class UserInfoServiceImpl implements IUserService {

    @Resource
    private UserMapper userMapper;

    @Override
    public User getUser(int id) {
        return null;
    }

    @Override
    public User getUser(User user) {
        return userMapper.selectOne(user);
    }

    @Override
    public PageInfo<User> getUserList(Integer pageNum, Integer pageSize, User user) {
        PageHelper.startPage(pageNum, pageSize);
        List<User> userList = userMapper.select(user);
        return new PageInfo<>(userList);
    }

    @Override
    public Integer addUser(User user) {
        return null;
    }

    @Override
    public Integer updateUser(User user) {
        return null;
    }

    @Override
    public Integer deleteUser(User user) {
        return null;
    }
}
